<<<<<<< .mine
function LogickeHodnotyLevel(type){
    this.name = "levelLogic"
    this.picturePath = Game.picturesPath + "levels/"+this.name + "/";
    Sprite.apply(this);
    Level.apply(this);   
    this.requiredTime = 30;
    this.type = type;
    this.circles = new Array(16);
    this.manual = new Manual (this.picturePath);
    this.andText = new TextField();
    this.orText = new TextField();
    // methods            
    this.isSolved = isSolved;
    this.init = init;
    
    function isSolved(){
        var result = true;
        result &= !this.circles[6].value;
        result &= !this.circles[10].value;
        result &= !this.circles[14].value;
        result &= !this.circles[15].value;
        result &= this.circles[2].value;
        result &= this.circles[3].value;
        result &= this.circles[7].value;
        result &= this.circles[11].value;
        if (result)
            this.timer.TimerStop();
        return result;
    }
    
    function init (){
        this.andText.setTextFormat(new TextFormat(font, 20, white));
        this.andText.text = "AND";
        this.andText.width = 100; 
        this.andText.height = this.andText.textHeight;
        this.andText.x = 410; 
        this.andText.y = 20;
        
        this.orText.setTextFormat(new TextFormat(font, 20, white));
        this.orText.text = "OR";
        this.orText.width = 100; 
        this.orText.height = this.orText.textHeight;
        this.orText.x = 535; 
        this.orText.y = 20;
        
        for (var i=0; i<this.circles.length; i++) {
            if(i == 0 || i == 1 || i == 4 || i == 5 || i == 8 || i == 9 || i == 12 || i == 13){
                if(i == 0 || i == 1 || i == 4 || i == 9 ){
                    this.circles[i] = new BoolCircle((i % 4) * 120 + 190, Math.floor(i / 4) * 100 + 80,true,false,this.picturePath);
                }else{
                    this.circles[i] = new BoolCircle((i % 4) * 120 + 190, Math.floor(i / 4) * 100 + 80,false,false,this.picturePath);
                }                    
            }else{
                this.circles[i] = new BoolCircle((i % 4) * 120 + 190, Math.floor(i / 4) * 100 + 80,false,true,this.picturePath);
            }
                    
            this.addChild(this.circles[i]);
        }
         
        this.addChild(this.andText);
        this.addChild(this.orText);
        this.addChild (this.manual);     
    }
                          
}                       
LogickeHodnotyLevel.prototype = new Sprite();
LogickeHodnotyLevel.tFormat   = new TextFormat(font, 30, black);
LogickeHodnotyLevel.tFormat.align = TextFormatAlign.CENTER;=======
function LogickeHodnotyLevel(){
    Sprite.apply(this);
    Level.apply(this);           
    var circles = new Array(16);
                
    var andText = new TextField();
    andText.setTextFormat(new TextFormat(font, 20, white));
    andText.text = "AND";
    andText.width = 100; 
    andText.height = andText.textHeight;
    andText.x = 410; 
    andText.y = 20;
    this.addChild(andText);
                
    var orText = new TextField();
    orText.setTextFormat(new TextFormat(font, 20, white));
    orText.text = "OR";
    orText.width = 100; 
    orText.height = andText.textHeight;
    orText.x = 535; 
    orText.y = 20;
    this.addChild(orText);
                
    this.isSolved = isSolved;
    function isSolved(){
        var result = true;
        result &= !circles[6].value;
        result &= !circles[10].value;
        result &= !circles[14].value;
        result &= !circles[15].value;
        result &= circles[2].value;
        result &= circles[3].value;
        result &= circles[7].value;
        result &= circles[11].value;
        return result;
    }
                      
    for (var i=0; i<circles.length; i++) {
        if(i == 0 || i == 1 || i == 4 || i == 5 || i == 8 || i == 9 || i == 12 || i == 13){
            if(i == 0 || i == 1 || i == 4 || i == 9 ){
                circles[i] = new BoolCircle((i % 4) * 120 + 190, Math.floor(i / 4) * 100 + 80,true,false);
            }else{
                circles[i] = new BoolCircle((i % 4) * 120 + 190, Math.floor(i / 4) * 100 + 80,false,false);
            }                    
        }else{
            circles[i] = new BoolCircle((i % 4) * 120 + 190, Math.floor(i / 4) * 100 + 80,false,true);
        }
                    
        this.addChild(circles[i]);
    }
                
    this.addEventListener(MouseEvent.CLICK,click);
    this.click = click;
                
    function click(e){	
        if(isSolved()){
            e.target.parent.levelSolved();
        }else{
          //alert("not solved!");
        }
    }
                
             	  
}                       
LogickeHodnotyLevel.prototype = new Sprite();
LogickeHodnotyLevel.prototype = new Level();
LogickeHodnotyLevel.tFormat   = new TextFormat(font, 30, black);
LogickeHodnotyLevel.tFormat.align = TextFormatAlign.CENTER;>>>>>>> .r36
